package com.metaera.app.controller.presenter;

import com.metaera.app.controller.core.RequestPresenter;
import com.metaera.app.controller.view.core.INetworkRequestView;
import com.metaera.app.data.DataRepository;
import com.metaera.app.data.model.InformationDetailsResponse;
import com.metaera.app.data.rx.ResponseObserver;
import com.metaera.app.data.rx.SchedulersTransformer;

public class ArticleDetailsPresenter extends RequestPresenter<INetworkRequestView<InformationDetailsResponse>> {

    public void execute(int id){
        DataRepository.getInstance()
                .getInformationDetails(String.valueOf(id))
                .compose(SchedulersTransformer.transformer())
                .subscribe(new ResponseObserver<>(
                                this,
                                mView,
                                response -> mView.successful(response.getData())
                        )
                );

//        DataRepository.getInstance()
//                .getActivityDetails(id)
//                .compose(SchedulersTransformer.transformer())
//                .subscribe(new ResponseObserver<>(
//                                this,
//                                mView,
//                                response -> mView.successful(response.getData())
//                        )
//                );
    }

}
